]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
windowAttentionHandler: Follow app policy for attention notifications
authorFlorian Müllner <fmuellner@gnome.org>
Mon, 23 Oct 2017 08:06:18 +0000 (10:06 +0200)
committerFlorian Müllner <fmuellner@gnome.org>
Thu, 26 Oct 2017 17:39:04 +0000 (19:39 +0200)
While window attention notifications are created by the shell itself
rather than applications (most likely as a result of focus stealing
prevention), users still commonly link them to the application for
which they are shown. It makes therefore sense to follow the appropriate
policy set by the user rather than showing them unconditionally.

https://bugzilla.gnome.org/show_bug.cgi?id=779974

js/ui/windowAttentionHandler.js

index d56f6b20beca529dbe0401fdf2e0bfa328697864..edd671a2cc035f4a9035ed54096e514df52e6ceb 100644 (file)
@@ -79,6 +79,15 @@ var Source = new Lang.Class({
         this.signalIDs = [];
     },
 
+    _createPoliy: function() {
+        if (this._app && this._app.get_app_info()) {
+            let id = this._app.get_id().replace(/\.desktop$/,'');
+            return new MessageTray.NotificationApplicationPolicy(id);
+        } else {
+            return new MessageTray.NotificationGenericPolicy();
+        }
+    },
+
     createIcon : function(size) {
         return this._app.create_icon_texture(size);
     },